package com.tuteng.administrator.ashospital.Manager;

import android.os.Handler;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.tuteng.administrator.ashospital.JsonCallback;
import com.tuteng.administrator.ashospital.beans.LandReqBean;
import com.tuteng.administrator.ashospital.comprehensive.LoadingDialogManager;

import static com.tuteng.administrator.ashospital.Config.GlobleConfig.APP_URL;

public class NetManager {
    private Handler handler;
    private  int msg;
    private String hurl;
    private Class clazz;
    private String js;
    public NetManager(Handler handler, int msg, String hurl, Class clazz,String json) {
        this.handler = handler;
        this.msg = msg;
        this.hurl = hurl;
        this.clazz = clazz;
        this.js=json;
        String posurl=APP_URL+hurl;
        LoadingDialogManager.getInstance().showDialog();
        OkGo.<LandReqBean>post(posurl)
                .tag(this)
                .upJson(js)
                .execute(new JsonCallback<LandReqBean>() {
                    @Override
                    public void onSuccess(Response<LandReqBean> response) {
                        LandReqBean u=response.body();
                        LoadingDialogManager.getInstance().dismissDialog();
                        // System.out.print(u.getAge()+"------->"+u.getName());
                    }
                });



    }




}
